package org.cicd.utils

/**
 * 安装 File Operations Plugin 插件
 *
 * @see https://github.com/jenkinsci/file-operations-plugin/blob/main/docs/JOB-DSL.md
 *
 * @param sourceFolderPath
 * @param destinationFolderPath
 * @return
 */
def copyFile(sourceFolderPath, destinationFolderPath) {
    // 在共享库中
    fileOperations ([
            fileCopyOperation(excludes: '', flattenFiles: false, includes: "${sourceFolderPath}", targetLocation: "${destinationFolderPath}" ),
//            folderCopyOperation(sourceFolderPath: "/path/to/foo", destinationFolderPath: "/path/to/bar")
    ])

}

def copyFolder(sourceFolderPath, destinationFolderPath) {
    fileOperations ([
                folderCopyOperation(sourceFolderPath: "${sourceFolderPath}", destinationFolderPath: "${destinationFolderPath}")
    ])
}